#if !defined(AFX_FIRSTDIAGPAGE_H__B72A79DB_27D7_43FB_933E_ED94C10E6975__INCLUDED_)
#define AFX_FIRSTDIAGPAGE_H__B72A79DB_27D7_43FB_933E_ED94C10E6975__INCLUDED_

#include "PageDialog.h"
#include "../Gait/GaitAnaly.h"

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// FirstDiagPage.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CFirstDiagPage dialog

class CGaitAnaly;
class CFirstDiagPage : public CPageDialog
{
// Construction
public:
	CFirstDiagPage(CWnd* pParent = NULL);   // standard constructor
	~CFirstDiagPage();

	virtual BOOL	Prepare();
	virtual BOOL	ClearUp();
	
	virtual BOOL	ShowTableData(CString strMRN);
	virtual BOOL	ClearData();
	virtual BOOL	EnableInputControls(BOOL bEnable);
	

// Dialog Data
	//{{AFX_DATA(CFirstDiagPage)
	enum { IDD = IDD_DIALOG_PAGE_FIRST_CLIN };
	CSpinButtonCtrl	m_spinOpenValue;
	CSpinButtonCtrl	m_spinCloseValue;
	//}}AFX_DATA


// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CFirstDiagPage)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(CFirstDiagPage)
	virtual BOOL OnInitDialog();
	afx_msg void OnBtnWriteParam();
	afx_msg void OnButtonSnap();
	afx_msg void OnDeltaposSpinCloseValue(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnDeltaposSpinOpenValue(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnButtonContinue();
	afx_msg void OnChangeEditStiOpen();
	afx_msg void OnChangeEditStiClose();
	//}}AFX_MSG
	afx_msg void OnRefreshOpenClose(WPARAM wParam, LPARAM lParam);
	DECLARE_MESSAGE_MAP()

private:
	BOOL					WriteWAParams();
	BOOL					SaveDiagRecord();
	BOOL					StopGait();
	BOOL					DrawPausedStaticGait();
	BOOL					GetBasicParamToDisplay();

	static void	CALLBACK	ShowGaitTimerFunc(HWND hWnd, UINT nMsg, UINT nIDEvent, DWORD dwTime);
		
private:
	CGaitAnaly*			m_pGaitDraw;
	WA_BASIC_PARA		m_BasicPara;

	DWORD				m_adwGaitSnap[GAIT_POINT_ARRAY_SIZE];
	int					m_nStartPos;
	DWORD				m_dwStiOpen;
	DWORD				m_dwStiClose;

	BOOL				m_bTextChangeFromGait;
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_FIRSTDIAGPAGE_H__B72A79DB_27D7_43FB_933E_ED94C10E6975__INCLUDED_)
